package cn.fay.chapter13;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class AppendReplacementDemo {
	private static final String str="abcdefghijklmn";
	public static void main(String[] args) {
		
		Pattern p=Pattern.compile("[aeio]");
		Matcher m1=p.matcher(str);
		
		StringBuffer sb=new StringBuffer();
		while (m1.find()) 
			m1.appendReplacement(sb, m1.group().toUpperCase());
		m1.appendTail(sb);
		System.out.println(sb);
	}
}
